package cn.acheng1314.springboot2

import cn.acheng1314.springboot2.entity.AdminUser
import cn.acheng1314.springboot2.mapper.AdminUserMapper
import cn.acheng1314.springboot2.service.impl.AdminUserServiceImpl
import com.baomidou.mybatisplus.core.toolkit.Wrappers
import org.junit.Test
import org.junit.runner.RunWith
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner


class Springboot2ApplicationTests : BaseTest() {

    private val log = LoggerFactory.getLogger(this::class.java)

    @Autowired
    private lateinit var adminUserMapper: AdminUserMapper

    @Autowired
    private lateinit var adminUserService: AdminUserServiceImpl

    @Test
    fun testUserDao() {
        val list = adminUserMapper.selectList(Wrappers.lambdaQuery<AdminUser>())
        list.forEach { u -> log.info(u.toString()) }
    }

    @Test
    fun testUserService() {
        val list = adminUserService.selectList()
        list?.forEach { u -> println(u.toString()) }
    }

}
